/**
 * Created by xiangyufang on 2016/11/18.
 */
var deviceTemplate = {

    // 阴保电源
    power: [
        {name: 'customNumber', title: '设备编号：'},
        {name: 'pipeValveroomName', title: '所属场站阀室：'},
        {name: 'cppowerType', title: '阴保电源类型：'},
        {name: 'ratedvoltsOut', title: '额定电压(V)：'},
        {name: 'ratedampsout', title: '额定电流(A)：'},
        {name: 'protectionObject', title: '保护对象：'},
        {name: 'objectName', title: '对象名称：'},
        {name: 'manufacturer', title: '生产厂商：'},
        {name: 'serialNumber', title: '出厂编号：'},
        {name: 'model', title: '型号：'},
        {name: 'telephone', title: '厂家联系电话：'},
        {name: 'manufactureDate', title: '生产日期：'},
        {name: 'inserviceDate', title: '投用日期：'},

        {name: 'recorder', title: '记录人：'},
        {name: 'recordTime', title: '记录时间：'},
        {name: 'remarks', title: '备注：'}
    ],

    //长效参比
    long: [
        {name: 'pipeLineName', title: '管道名称：'},
        {name: 'pipeValveroomName', title: '所属场站阀室：'},
        {name: 'customNumber', title: '设备编号：'},
        {name: 'testStationNumber', title: '测试桩编号：'},
        {name: 'referenceTypes', title: '参比电极类型：'},
        {name: 'necessarysets', title: '配套装置：'},
        {name: 'inserviceDate', title: '投用日期：'},
        {name: 'manufacturer', title: '生产厂商：'},
        {name: 'serialNumber', title: '出厂编号：'},
        {name: 'assemblyCompany', title: '施工单位：'},

        {name: 'recorder', title: '记录人：'},
        {name: 'recordTime', title: '记录时间：'},
        {name: 'remarks', title: '备注：'}
    ],

    // 阳极地床
    bed: [
        {name: 'customNumber', title: '设备编号：'},
        {name: 'testStationNumber', title: '测试桩编号：'},
        {name: 'pipeValveroomName', title: '所属场站阀室：'},
        {name: 'materialType', title: '阳极材料类型：'},
        {name: 'classNumberOfAnodes', title: '阳极支/组数：'},
        {name: 'groundbeDstructure', title: '地床构造：'},
        {name: 'backFillMaterial', title: '回填材料：'},
        {
            name: 'waterSystemind',
            title: '是否有注水系统：',
            render: function (d) {
                if(d == '1'){
                    return '是';
                }else if(d == '0'){
                    return '否';
                }else{
                    return '未知';
                }
            }
        },
        {name: 'protectionObject', title: '保护对象：'},
        {name: 'objectName', title: '对象名称：'},
        {name: 'groundingResistance', title: '接地电阻(Ω)：'},
        {name: 'buriedsoilResistivity', title: '埋设点土壤电阻率(Ω.m)：'},
        {name: 'verticalDistance', title: '与管道垂直间距(m)：'},
        {name: 'necessarysets', title: '配套装置：'},
        {name: 'frozensoilDepth', title: '冻土层厚度(m)：'},
        {name: 'environment', title: '埋设环境描述：'},
        {name: 'manufacturer', title: '生产厂商：'},
        {name: 'serialNumber', title: '出厂编号：'},
        {name: 'inserviceDate', title: '投用日期：'},
        {name: 'assemblyCompany', title: '施工单位：'},
        {name: 'recorder', title: '记录人：'},
        {name: 'recordTime', title: '记录时间：'},
        {name: 'remarks', title: '备注：'}
    ],

    //绝缘装置
    insu: [
        {name: 'pipeLineName', title: '管道名称：'},
        {name: 'pipeValveroomName', title: '所属场站阀室：'},
        {name: 'customNumber', title: '设备编号：'},
        {name: 'testStationNumber', title: '测试桩编号：'},
        {name: 'insulatedJointType', title: '绝缘装置类型：'},
        {name: 'mountingType', title: '安装类别：'},
        {name: 'relativePositionRelation', title: '安装位置：'},
        {name: 'mileage', title: '绝对距离(m)：'},
        {name: 'protectionFacilities', title: '保护设施：'},
        {name: 'resistance', title: '绝缘装置绝缘电阻(MΩ)：'},
        {name: 'inserviceDate', title: '投用日期：'},
        {name: 'manufacturer', title: '生产厂商：'},
        {name: 'serialNumber', title: '出厂编号：'},
        {name: 'assemblyCompany', title: '施工单位：'},
        {name: 'inspectingCompany', title: '监理单位：'},
        {name: 'testingCompany', title: '检测单位：'},

        {name: 'recorder', title: '记录人：'},
        {name: 'recordTime', title: '记录时间：'},
        {name: 'remarks', title: '备注：'}
    ],

    // 防浪涌保护器
    avoid: [
        {name: 'pipeLineName', title: '管道名称：'},
        {name: 'pipeValveroomName', title: '所属场站阀室：'},
        {name: 'customNumber', title: '设备编号：'},
        {name: 'teststationnumber', title: '测试桩编号：'},
        {name: 'potectorType', title: '保护器类型：'},
        {name: 'mountingType', title: '安装类别：'},
        {name: 'specifications', title: '规格型号：'},
        {name: 'potectorpurpose', title: '被保护装置及编号：'},
        {name: 'inserviceDate', title: '投用日期：'},
        {name: 'manufactureDate', title: '生产日期：'},
        {name: 'manufacturer', title: '生产厂商：'},
        {name: 'serialNumber', title: '出厂编号：'},
        {name: 'assemblyCompany', title: '施工单位：'},

        {name: 'recorder', title: '记录人：'},
        {name: 'recordTime', title: '记录时间：'},
        {name: 'remarks', title: '备注：'},
        {name:'mileage',title:'位置信息：',render:function(){return ''},node:[
            {name: 'mileage', title: '绝对距离：',render:function(d){return d + 'm'}},
            {name: 'nagm', title: '最近测试桩：'},
            {name: 'nagmMileage', title: '相对最近测试桩距离：',render:function(d){return d + 'm'}}
        ]}
    ],

    // 跨接线
    line: [
        {name: 'pipeLineName', title: '管道名称：'},
        {name: 'pipeValveroomName', title: '所属场站阀室：'},
        {name: 'customNumber', title: '设备编号：'},
        {name: 'teststationnumber', title: '测试桩编号：'},
        {name: 'inserviceDate', title: '投用日期：'},
        {name: 'assemblyCompany', title: '施工单位：'},

        {name: 'recorder', title: '记录人：'},
        {name: 'recordTime', title: '记录时间：'},
        {name: 'remarks', title: '备注：'},
        {name:'beginMileage',title:'起点位置：',render:function(){return ''},node:[
            {name: 'beginMileage', title: '绝对距离：',render:function(d){return d + 'm'}},
            {name: 'beginNagm', title: '最近测试桩：'},
            {name: 'beginNagmMileage', title: '相对最近测试桩距离：',render:function(d){return d + 'm'}},
            {name: 'beginSpotweld', title: '焊点信息：'}
        ]},
        {name:'endMileage',title:'终点位置：',render:function(){return ''},node:[
            {name: 'endMileage', title: '绝对距离：',render:function(d){return d + 'm'}},
            {name: 'endNagm', title: '最近测试桩：'},
            {name: 'endNagmMileage', title: '相对最近测试桩距离：',render:function(d){return d + 'm'}},
            {name: 'endSpotweld', title: '焊点信息：'}
        ]}
    ],

    //阴保测试桩
    pile: [
        {name: 'pipeLineName', title: '管道名称：'},
        {name: 'customNumber', title: '测试桩编号：'},
        {name: 'mileage', title: '绝对距离(m)：'},
        {name: 'material', title: '材质：'},
        {name: 'purpose', title: '功能：'},
        {name: 'solderJointsCorrosion', title: '焊点防腐类型：'},
        {name: 'manufacturer', title: '生产厂商：'},
        {name: 'inserviceDate', title: '投用日期：'},
        {name: 'assemblyCompany', title: '施工单位：'},
        {name: 'inspectingCompany', title: '监理单位：'},

        {name: 'recorder', title: '记录人：'},
        {name: 'recordTime', title: '记录时间：'},
        {name: 'remarks', title: '备注：'}
    ],

    // 牺牲阳极
    sacri: [
        {name: 'pipeLineName', title: '管道名称：'},
        {name: 'customNumber', title: '设备编号：'},
        {name: 'teststationnumber', title: '测试桩编号：'},
        {name: 'material', title: '材质：'},

        {name: 'sacrificialAnodeType', title: '牺牲阳极类型：'},
        {name: 'anodeCount', title: '阳极支数：'},
        {name: 'anodeWeight', title: '单支阳极重量(kg)：'},

        {name: 'anodeLength', title: '阳极长度(m)：'},
        {name: 'anodeRibbonWeight', title: '阳极带线质量(kg/m)：'},
        {name: 'installation', title: '安装方式：'},

        {name: 'soilResistivity', title: '土壤电阻率(Ω.m)：'},
        {name: 'protectionObject', title: '保护对象：'},
        {name: 'manufacturer', title: '生产厂商：'},

        {name: 'serialNumber', title: '出厂编号：'},
        {name: 'coatingMaterial', title: '焊点防腐类型：'},
        {name: 'assemblyCompany', title: '施工单位：'},

        {name: 'inserviceDate', title: '投用日期：',render:function(d){
            return Dyy.getDate(d);
        }},
        {name: 'recorder', title: '记录人：'},
        {name: 'recordTime', title: '记录时间：'},
        {name: 'remarks', title: '备注：'},
        {name:'solderMileage',title:'管体电缆焊点：',render:function(){return ''},node:[
            {name: 'solderMileage', title: '绝对距离：',render:function(d){return d + 'm'}},
            {name: 'solderNagm', title: '最近测试桩：'},
            {name: 'solderNagmMileage', title: '相对最近测试桩距离：',render:function(d){return d + 'm'}}
        ]},
        {name:'beginMileage',title:'牺牲阳极起点：',render:function(){return ''},node:[
            {name: 'beginMileage', title: '绝对距离：',render:function(d){return d + 'm'}},
            {name: 'beginNagm', title: '最近测试桩：'},
            {name: 'beginNagmMileage', title: '相对最近测试桩距离：',render:function(d){return d + 'm'}}
        ]},
        {name:'endMileage',title:'牺牲阳极终点：',render:function(){return ''},node:[
            {name: 'endMileage', title: '绝对距离：',render:function(d){return d + 'm'}},
            {name: 'endNagm', title: '最近测试桩：'},
            {name: 'endNagmMileage', title: '相对最近测试桩距离：',render:function(d){return d + 'm'}}
        ]}
    ],

    // 排流装置
    elec: [
        {name: 'pipeLineName', title: '管道名称：'},
        {name: 'customNumber', title: '设备编号：'},
        {name: 'teststationnumber', title: '测试桩编号：'},

        {name: 'currentdrainage', title: '排流器类型：'},
        {name: 'grounDbeDstructure', title: '地床构造：'},
        {name: 'groundingType', title: '排流地床类型：'},

        {name: 'rodEarthingBodyCount', title: '棒状接地体支数：'},
        {name: 'stripGroundBodyLength', title: '带状接地体长度(m)：'},
        {name: 'groundingResistance', title: '排流地床接地电阻(Ω)：'},

        {name: 'groundRelativeLocation', title: '排流地床与管道相对位置：'},
        {name: 'deviceManufactureDate', title: '排流器生产日期：'},
        {name: 'materialManufactureDate', title: '排流器地床材料生产日期：',render:function(d){
            return Dyy.getDate(d);
        }},

        {name: 'deviceManufacturer', title: '排流器生产厂商：'},
        {name: 'materialManufacturer', title: '排流器地床材料生产厂商：'},
        {name: 'deviceFactoryNumber', title: '排流器出厂编号：'},

        {name: 'materialFactoryNumber', title: '排流器地床材料出厂编号：'},
        {name: 'inserviceDate', title: '投用日期：'},
        {name: 'assemblyCompany', title: '施工单位：'},

        {name: 'testingCompany', title: '检测单位：'},
        {name: 'recorder', title: '记录人：'},
        {name: 'recordTime', title: '记录时间：'},
        {name: 'remarks', title: '备注：'},

        {name:'solderMileage',title:'管体电缆焊点：',render:function(){return ''},node:[
            {name: 'solderMileage', title: '绝对距离：',render:function(d){return d + 'm'}},
            {name: 'solderNagm', title: '最近测试桩：'},
            {name: 'solderNagmMileage', title: '相对最近测试桩距离：',render:function(d){return d + 'm'}}
        ]},
        {name:'beginMileage',title:'排流装置地床起点：',render:function(){return ''},node:[
            {name: 'beginMileage', title: '绝对距离：',render:function(d){return d + 'm'}},
            {name: 'beginNagm', title: '最近测试桩：'},
            {name: 'beginNagmMileage', title: '相对最近测试桩距离：',render:function(d){return d + 'm'}}
        ]},
        {name:'endMileage',title:'排流装置地床终点：',render:function(){return ''},node:[
            {name: 'endMileage', title: '绝对距离：',render:function(d){return d + 'm'}},
            {name: 'endNagm', title: '最近测试桩：'},
            {name: 'endNagmMileage', title: '相对最近测试桩距离：',render:function(d){return d + 'm'}}
        ]}
    ]
};